namespace PraceDyplomowe2.Migrations
{
    using System;
    using System.Data.Entity.Migrations;
    
    public partial class ChangeUserToTematyRelation : DbMigration
    {
        public override void Up()
        {
            DropForeignKey("dbo.Temats", "UserProfile_UserId", "dbo.UserProfiles");
            DropIndex("dbo.Temats", new[] { "UserProfile_UserId" });
            RenameColumn(table: "dbo.Temats", name: "UserProfile_UserId", newName: "PromotorId");
            AddForeignKey("dbo.Temats", "PromotorId", "dbo.UserProfiles", "UserId", cascadeDelete: true);
            CreateIndex("dbo.Temats", "PromotorId");
        }
        
        public override void Down()
        {
            DropIndex("dbo.Temats", new[] { "PromotorId" });
            DropForeignKey("dbo.Temats", "PromotorId", "dbo.UserProfiles");
            RenameColumn(table: "dbo.Temats", name: "PromotorId", newName: "UserProfile_UserId");
            CreateIndex("dbo.Temats", "UserProfile_UserId");
            AddForeignKey("dbo.Temats", "UserProfile_UserId", "dbo.UserProfiles", "UserId");
        }
    }
}
